# Maintainer: Diego Sogari <diego.sogari@gmail.com>

_realname=lmdbxx
pkgbase=mingw-w64-${_realname}
pkgname="${MINGW_PACKAGE_PREFIX}-${_realname}"
pkgver=0.9.14.0
pkgrel=1
pkgdesc="C++11 wrapper for LMDB (mingw-w64)"
arch=('any')
url="https://lmdbxx.sourceforge.io/"
license=('custom')
makedepends=("${MINGW_PACKAGE_PREFIX}-gcc")
depends=("${MINGW_PACKAGE_PREFIX}-lmdb")
source=("${_realname}-${pkgver}.tar.gz::https://codeload.github.com/bendiken/lmdbxx/tar.gz/${pkgver}")
sha256sums=('99ae16599829c7c9dfb396382bb8e774031ca7e839c38e0c5fef124f409f19a2')
noextract=("${_realname}-${pkgver}.tar.gz")

prepare() {
  tar xf "${_realname}-${pkgver}.tar.gz" --exclude=README
  cd "${srcdir}/${_realname}-${pkgver}"
  sed -e "s|/usr/local|${MINGW_PREFIX}|g" -i Makefile
}

package() {
  cd "${srcdir}/${_realname}-${pkgver}"
  make DESTDIR="${pkgdir}" install
}
